﻿using System;

using RexToy.Template.Text;

namespace ScriptXCompiler
{
    abstract class Template
    {
        protected Template(string begin, string end)
        {
            _begin = begin;
            _end = end;
        }

        protected StringTemplate _begin;
        protected StringTemplate _end;

        public string GetBeginString()
        {
            return _begin.Render();
        }

        public string GetEndString()
        {
            return _end.Render();
        }

        public virtual Template Assign(string key, string val)
        {
            _begin.Assign(key, val, false);
            _end.Assign(key, val, false);
            return this;
        }
    }
}
